#pragma once
#include "KeyConverter.h"

/**
================================
A processed MouseEvent is passed to a 
Listener for comsuption
================================
*/
class MouseEvent
{
public:
    MouseEvent(void): m_Button(0),m_X(0), m_Y(0), m_Modifier(0) {};
    MouseEvent( int button, int X, int Y, int mod ) : m_Button(button),
                                                      m_X(X), m_Y(Y),
                                                      m_Modifier( mod ) {};

    /** Get the Button that was down */
    int GetButton() const { return m_Button; };

    /** Get the button as a str */
    std::string GetButtonStr() const { return m_keyConverter.ToString( m_Button ); };
    
    int GetX() const { return m_X; };     /** Get the X location of the mouse cursor */
    int GetY() const { return m_Y; };     /** Get the Y location of the mouse cursor */

    /** Return any modifier flags */
    int GetModifiers() const { return m_Modifier; };

    /**
        Mouse Modifiers
    */
    enum Modifier_t
    {
        MOTION          = (1<<1),
        BUTTON_DOWN     = (1<<2),
        BUTTON_RELEASED = (1<<3),
        BUTTON          = ( BUTTON_DOWN | BUTTON_RELEASED ),

        WHEEL_UP        = (1<<4),
        WHEEL_DOWN      = (1<<5),
        WHEEL           = ( WHEEL_UP | WHEEL_DOWN )
    };

private:
    KeyConverter    m_keyConverter;
    int         m_Button;           // button associated with the action
    int         m_Modifier;         // any flags 
    int         m_X;                // x pos
    int         m_Y;                // y pos of mouse cursor
public:
    virtual ~MouseEvent(void) {};
};
